#include "bullet.h"
#include <QPainter>

Bullet::Bullet()
{
}
QRectF Bullet::boundingRect() const
{
    qreal adjust = 0.5;
    return QRectF(-18 - adjust, -22 - adjust, 36 + adjust, 60 + adjust);
}
QPainterPath Bullet::shape() const
{
    QPainterPath path;
    path.addRect(-10, -20, 20, 40);
    return path;
}
void Bullet::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    QColor color(255, 0, 0);
    painter->setBrush(color);
    painter->drawEllipse(-10, -20, 20, 40);
}
void Bullet::advance(int step)
{
    this->setPos(this->x()+10, this->y()+10);
}
